﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Examples_TextBoxExample : System.Web.UI.MobileControls.MobilePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        this.TextBox2.TextChanged += new System.EventHandler(this.Verify_OnTextChanged);
        this.cmdButton.Click += new System.EventHandler(this.cmdButton_Click);
    }
    protected void Verify_OnTextChanged(Object sender, EventArgs e)
    {
        if (TextBox1.Text != TextBox2.Text)
        {
            Label2.Visible = true;
            Label2.StyleReference = "error";
            Label2.Text = "No match - please reenter";
        }
    }

    protected void cmdButton_Click(Object sender, EventArgs e)
    {
        if (TextBox1.Text == TextBox2.Text)
        {
            Label1.Visible = false;
            Label2.Visible = false;
            Label3.Visible = false;
            TextBox1.Visible = false;
            TextBox2.Visible = false;
            Label4.Text = "Confirmed - Thanks";
        }
    }
}